package A.动态数组;

import java.util.HashMap;
import java.util.Map;

public class _面试题0101_判定字符是否唯一 {
    public boolean isUnique(String astr) {

        char[] chars = astr.toCharArray();
        Map<Integer,Character> map = new HashMap<>();
        for (int i=0;i<chars.length;i++){

            if (map.containsValue(chars[i])) {
                return false;
            }else {
                map.put(i,chars[i]);
            }

        }
        return true;
    }
}
